<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>${node.name}[#if
	node.parent??]_${node.parent.name}[/#if]_${site.fullNameOrName}${global.customs['poweredby']}</title>
<link href="_files/css.css" rel="stylesheet" />
<link href="_files/fuchuang.css" rel="stylesheet" />
<link href="_files/artDialog5/skins/default.css" rel="stylesheet" type="text/css" />
<link href="_files/js/layui/css/layui.css" rel="stylesheet" type="text/css" />

<script language="javascript" type="text/javascript" src="_files/artDialog5/artDialog.min.js"></script>
<script language="javascript" type="text/javascript" src="_files/js/line.js"></script>
<script language="javascript" type="text/javascript" src="_files/js/pop_dialog.js"></script>
<script language="javascript" type="text/javascript" src="_files/js/layui/layui.js"></script>
[#include 'inc_js.html'/]
<script>
	$(function() {
		$.each($
				("#zdcx").find("a"), function() {
			var name = $(this).html();
			$(this).attr("onclick", 'showValue(\"' + name + '\")');
		})
	});
	
	$(function() {
	$.ajax({
		type : 'get',
		async : false,
		url : '${ctx}/ext/line.htmx?lineId=2',
		dataType : 'json',
		error : function() {
			alert('系统连接失败，请稍后再试！');
		},
		success : function(result) {
			if (result.info.success){
				if (result.data != null && result.data.length > 0) {
					for (var i = 0; i < result.data.length; i++) {
						var stations = result.data[i].stations;
						var lineId = result.data[i].id;
						var lineName = result.data[i].name;
						$.each(stations,function(key,value){
							var stationId = value.id;
							var stationName = value.name;
							$("#zdcx").append("<a id='"+ stationId+ "' onclick=\"showValue('"+ stationName + "','"+ stationId + "');\">"+stationName+"</a>");
						})
					}
				}
			}
		}
	});
});
	
	function close() {
		$('#chooseStation').hide();
		$('#blackgroud').hide();
	}

	function removeElementsByClass(className){
	    var elements = document.getElementsByClassName(className);
	    while(elements.length > 0){
	        elements[0].parentNode.removeChild(elements[0]);
	    }
	}
	function showResult() {
		
		$('#result').show();
		var zhandian = $('#stationId').val()
		$("#road").html(zhandian + "周边公交信息");
		
		var text = "";
		var id = $('#stationId').attr('name');
		var oDivs = document.getElementById('result');
		var road = document.getElementById('road');
		removeElementsByClass("gjhc-chukou");

			$.ajax({
				type : 'get',
				async : false,
				url : '${ctx}/ext/entryInfo.htmx?stationId='+id,
				dataType : 'json',
				error : function() {
					alert('系统连接失败，请稍后再试！');
				},
				success : function(result) {
					if (result.info.success){
						if (result.data != null && result.data.length > 0) {
							for (var i = 0; i < result.data.length; i++) {
								text = '';
								var oDiv = document.createElement('div');
								oDiv.classList.add('gjhc-chukou');
								var entryInfo = result.data[i];
								var busTransferInfos = entryInfo.busTransferInfos;
								text += '<b><img src="_files/img/yunyingfuwu/bus-chukou-hui.png" width="21" height="21"> '+entryInfo.name+'出口:</b>'+'<table><tr>';
								$.each(busTransferInfos,function(k,v){
									text += '<td><span>'+ v.busInfo.busName + '：</span>'+v.busInfo.stationInfo + '</td>';
								});
								text += '</tr></table>';
								oDiv.innerHTML = text;
								oDivs.insertBefore(oDiv,road.siblings);
							}
						}
					}
				}
			});
	}

	
	function clickLi(obj) {
		$(obj).next(".menu-xiala").toggle();
	}
</script>
</head>

<body>
	<div class="top-bg-01">
		<div id="main">
			[#include 'inc_header.html'/]
			<div class="lianjie-index">
				你当前的位置： [#list node.hierarchy as n]<a
					href="${n.url}" class="a c-desc">${n.name}</a>[#if n_has_next] >
				[/#if][/#list]
			</div>
			<div class="main-main">
				<div id="left-menu">[#include 'level_second_leftMenu.html'/]</div>
				<p>
				<div class="list-right clearfix">
					<div class="list-right-shang bus-list">
						<div class="list-bus-search clearfix">
							<span>公交换乘:</span>
							<div>
								<input type="text" id='stationId' value="请点击选择地铁站点进行查询" readonly="true" onclick="showStation(this)" name></a>
							</div>
							<div onclick="showResult()">
								<a href = "#"><img src="_files/img/yunyingfuwu/gongjiao-search.png" width="40"
									height="26"></a>
								</p>
							</div>
						</div>

						<div class="gjhc-jieguo" id="result" style="">
							<p class="gjhc-jieguo-title" id="road">
								<img src="_files/img/yunyingfuwu/gongjiao-icon01.png" width="18"
									height="18">周边公交信息
							</p>
						</div>

					</div>
				</div>
			</div>


					 <!--站点查询弹屏样式  --> 
           <div id="chooseStation" class="undis" >
            <div class="zhandianchaxun-tanping clearfix">
             <div class="zhandian clearfix">
              <div class="xianlu-line02">
               <div class="line02-title">
                <span class="name-02">2号线</span>
                <span class="icon-02"></span>
               </div>
               <p class="zdcx-stations" id='zdcx'>
               </p>
              </div>
             </div>
            </div>
          </div>


			<!-- 点击公交换乘输入框弹出站点选择样式--删除
       <div class="bus-select">
         <div class="line-two">
          <p class="line-two-title">2号线</p>
          <ul>
          <li class="station-line01">东莞火车站</li>
          <li class="station-line02">茶山</li>
          <li class="station-line01">东莞火车站</li>
          <li class="station-line02">茶山</li>
          <li class="station-line01">东莞火车站</li>
          <li class="station-line02">茶山</li>
          <li class="station-line01">东莞火车站</li>
          <li class="station-line02">茶山</li>
          <li class="station-line01">东莞火车站</li>
          <li class="station-line02">茶山</li>
          <li class="station-line01">东莞火车站</li>
          <li class="station-line02">茶山</li>
          <li class="station-line01">东莞火车站</li>
          <li class="station-line02">茶山</li>
          <li class="station-line01">东莞火车站</li>
          <li class="station-line02">茶山</li>
         </ul>
        </div> 
      </div>
      -->
			<div class="clearboth"></div>
		<!--footer-->
		[#include 'inc_footer.html'/]
		<!--footer-end-->
		</div>
	</div>
	</div>
</body>
</html>